import Vue from "vue";

import Cookies from "js-cookie";

import "normalize.css/normalize.css";

import Element from "element-ui";

// 数据字典
import dict from "./components/Dict";

// 权限指令
import checkPer from "@/utils/permission";
import permission from "./components/Permission";
import "./assets/styles/element-variables.scss";

// global css
import "./assets/styles/index.scss";

import App from "./App";
import store from "./store";
import router from "./router/routers";

import "./assets/icons"; // icon
import "./router/index"; // permission control
import BaiduMap from "vue-baidu-map";
import DistanceTool from "bmaplib.distancetool";
Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥
  ak: "uQ1kN7e2ILDy4w5LGQ4c14uEd7KK2GGY",
});
// import VueI18n from "vue-i18n";

// Vue.use(VueI18n);
Vue.use(DistanceTool);
Vue.use(checkPer);
Vue.use(permission);
Vue.use(dict);
Vue.use(Element, {
  size: Cookies.get("size") || "small", // set element-ui default size
});

Vue.config.productionTip = false;
// const i18n = new VueI18n({
//   locale: localStorage.getItem("lang") || "zh-CN", // 语言标识
//   //this.$i18n.locale // 通过切换locale的值来实现语言切换
//   messages: {
//     "zh-CN": require("./assets/i18n/zh_CN"), // 中文语言包
//     "en-US": require("./assets/i18n/en_US"), // 英文语言包
//   },
// });

new Vue({
  el: "#app",
  router,
  store,
  // i18n,
  // silentTranslationWarn: true, // 去除国际化警告
  render: (h) => h(App),
});
